package com.change.study.data.app;

import com.change.study.data.entity.User;
import com.change.study.data.service.UserService;
import com.openyelp.client.RestFulClient;

public class RpcUtils {

	static String url = "http://ad.xabaoyi.com:8080/fatherknow/rpc";
	//static String url = "http://192.168.0.188:8080/fatherknow/rpc";

	public static void main(String[] args) {
		UserService s = get(UserService.class);
		
		 User m=new User();
		 m.setUsername("ada");
		 m.setEmail("f");
		 m.setPassword("123456");
		 m.setPlainPassword("123456");
		 //s.save(m);
		 System.out.println(s.login("ada", "123456", "mac"));
	}

	public static <T> T get(Class<T> classx) {
		T s = RestFulClient.getService(url, classx);
		return s;
	}
}
